//
//  main.m
//  oc_11
//
//  Created by 楼楚 on 15/9/12.
//  Copyright (c) 2015年 Chu Lou. All rights reserved.
//

#import <Foundation/Foundation.h>
@interface Person:NSObject

@end
@implementation Person
//- (NSString *) description
//{
//    return @"This is person description";
//}

@end

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        Person *p = [[Person alloc]init];
        NSArray *arr = [[NSArray alloc]initWithObjects:@"one",@"two",@"three",p, nil];
        
        NSArray *arr1 = [[NSArray alloc]initWithObjects:@"one",@"two",p, nil];
        
        
        
        NSArray *arr2 = [[NSArray alloc]initWithArray:arr];
        
        
        NSArray *arr3 = [[NSArray alloc]initWithArray:arr copyItems:YES];
        NSLog(@"%@",arr3);
        //  数组可以装任意对象 数组中的每一个对象 是指向该对象的地址
//        NSLog(@"%@",arr);
//        NSLog(@"%@",arr1);
//           数组的遍历
//         枚举器遍历法
        NSEnumerator *enumerrator = [arr objectEnumerator];
        id obj;
        while (obj = [enumerrator nextObject]) {
            
            NSLog(@"%@",obj);
        }
//        快速遍历法
        for (obj in arr) {
            NSLog(@"%@",obj);

        }
//        i  遍历法
        NSInteger count = [arr count];
        id temObj = [arr objectAtIndex:0];
        NSInteger i = 0;
        for (i; i < [arr count]; ++i) {
            NSLog(@"%@",[arr objectAtIndex:i]);
        }
    }
    return 0;
}
